package com.demo.salary.abstracttransactions;

import com.demo.salary.payrolldomain.Affiliation;
import com.demo.salary.payrolldomain.Employee;

public abstract class ChangeAffiliationTransaction extends ChangeEmployeeTransaction {

    public ChangeAffiliationTransaction(int empId) {
        super(empId);
    }

    abstract Affiliation getAffiliation();

    abstract void recordMembership(Employee employee);

    @Override
    public void change(Employee employee) {
        recordMembership(employee);
        employee.setAffiliation(getAffiliation());
    }
}
